package Enemies;

import info.gridworld.grid.Location;

import java.util.ArrayList;

import Generator.Generate;
import Manage.Counter;
//pretty easy boss by the time you get to him
public class Drago extends Enemy{

	public Drago(ArrayList<Location> path) {
		super(path);
		setMaxHealth(100000);
		setSpeed(-2);
	}
	public void act(){ 
		if(getLocation() != null){
			if(getLocation().equals(path.get(path.size()-1))){ 
				removeSelfFromGrid(getLocation());
				Counter.takeLife();
			}else{
				if(speed >= 0){
					for(int i = 0; i < speed; i++){
						if(getLocation().equals(path.get(path.size()-1))){ 
							removeSelfFromGrid(getLocation());
							for(int j = 0; j < Counter.getLives(); j++){
								Counter.takeLife();
							}
							break;
						}
						move();
						moveLoc++;
					}
				}else{
					speedStep--;
					if(speedStep <= speed){
						move();
						moveLoc++;
						speedStep = 0;
					}
				}
				 
			}
		}	
	}
	public void die(){
		super.die();
		//play music =( couldn't find clip OVER 9000!!!!
		Generate.getWorld().OutputGameWon();
	}
}
